<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>员工表</title>
	<link href="css/index.css" rel="stylesheet" type="text/css" />
</head>
<body>
	<div>
  	<h1>员工信息列表</h1>
    <div class="main">
      <form action="" method="get">
            <span>快速查询：</span><input type="text" placeholder="请输入搜索关键字"  value="<?php echo $search ;?>" name="search"/>
          <input type='submit' value="搜索" />
      </form>
      <a href="tj_index.php">添加员工</a>
    </div>
  	<table border="1" width="90%" cellspacing="0">
  		<tr class="tr">
  			<th>ID</th>
  			<th>姓名</th>
  			<th>所属部门</th>
  			<th>头像</th>
  			<th>出生日期</th>
  			<th>入职日期</th>
  			<th>相关操作</th>
  		</tr>
  		<?php
  			foreach ($emplist as $a)
  			{
  		?>
  		<tr>
  			<td><?php echo $a["e_id"]?></td>
  			<td><?php echo $a["e_name"]?></td>
  			<td><?php echo $a["e_dept"]?></td>
  			<td><img src='<?php echo $a["e_img"]?>'.jpg /></td>
  			<td><?php echo $a["date_of_birth"]?></td>
  			<td><?php echo $a["date_of_entry"]?></td>
  			<td>
  				<a href="javascript:location.href='empupdate.php?id=<?php echo $a["e_id"]?>'">编辑</a>　
  				<a href="javascript:" onclick="if(confirm('确定删除吗？')) location.href='empdel.php?id=<?php echo $a["e_id"]?>'">删除</a>
  			</td>
  		</tr>
  		<?php
  			}
  		?>
  	</table>
    <ul id="page">
        <?php
           $pre=(($page-1)<=0)?1:($page-1);
           $next=(($page+1)>$maxpage)?$maxpage:($page+1);                    
        ?>
        <li><a href="index.php?page=1">首页</a></li>
        <li><a href="index.php?page=<?php echo $pre; ?>">上一页</a></li>
        <li><a href="index.php?page=<?php echo $next; ?>">下一页</a></li>
        <li class="last"><a href="index.php?page=<?php echo $maxpage; ?>">尾页</a></li>
    </ul>
	</div>
</body>
</html>